#pragma once

#include <fstream>
#include <vector>
using namespace std;

#include "typedefs.h"
#include "vector3.h"

using namespace Math;

namespace TriWriter
{
   bool OpenFile(const char* filename, ofstream& fout);

   bool WriteTriFile(const char* filename, const vector<Vector3>& vs, const vector<int>& fs);
   bool WriteTriFile(ofstream& ofile, const vector<Vector3>& vs, const vector<int>& fs);
   
   bool WriteOFFFile(const char* filename, const vector<Vector3>& vs, const vector<int>& fs);
	bool WriteOFFFile(ofstream& ofile, const vector<Vector3>& vs, const vector<int>& fs);

   bool WriteObjFile(const char* filename, const vector<Vector3>& vs, const vector<Vector3>& vn, const vector<int>& fs, const char *meshName = "a_mesh");
   bool WriteObjFile(ofstream& ofile, const vector<Vector3>& vs, const vector<Vector3>& vn, const vector<int>& fs, const char *meshName = "a_mesh");

   bool WritePOVFile(ofstream& ofile, const vector<Vector3>& vs, const vector<Vector3>& vn, const vector<int>& fs, const char *meshName = "a_mesh", int texId = 0, bool invertNormals = false);
};
